<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Linux命令工程场景 | whoway</title>
    <meta name="description" content="Personal Blog Website">
    <link rel="icon" href="/images/photo.jpg">
  <link rel="manifest" href="/images/photo.jpg">
  <link rel="apple-touch-icon" href="/images/photo.jpg">
  <meta http-quiv="pragma" cotent="no-cache">
  <meta http-quiv="pragma" cotent="no-cache,must-revalidate">
  <meta http-quiv="expires" cotent="0">
    
    <link rel="preload" href="/assets/css/0.styles.0dbae9ec.css" as="style"><link rel="preload" href="/assets/js/app.c70e21ad.js" as="script"><link rel="preload" href="/assets/js/98.43be3caa.js" as="script"><link rel="prefetch" href="/assets/js/10.15222a53.js"><link rel="prefetch" href="/assets/js/100.7e0e5a86.js"><link rel="prefetch" href="/assets/js/101.efd59f25.js"><link rel="prefetch" href="/assets/js/102.dfbdc06c.js"><link rel="prefetch" href="/assets/js/103.d3ab2109.js"><link rel="prefetch" href="/assets/js/104.117957ef.js"><link rel="prefetch" href="/assets/js/105.046e8ff3.js"><link rel="prefetch" href="/assets/js/106.aebdc17d.js"><link rel="prefetch" href="/assets/js/107.248733c2.js"><link rel="prefetch" href="/assets/js/108.a2fecadc.js"><link rel="prefetch" href="/assets/js/109.35196857.js"><link rel="prefetch" href="/assets/js/11.770642f2.js"><link rel="prefetch" href="/assets/js/110.cf3d973c.js"><link rel="prefetch" href="/assets/js/111.f985889a.js"><link rel="prefetch" href="/assets/js/112.ad614f41.js"><link rel="prefetch" href="/assets/js/113.f666653c.js"><link rel="prefetch" href="/assets/js/114.c6c3f384.js"><link rel="prefetch" href="/assets/js/115.e51d3c2f.js"><link rel="prefetch" href="/assets/js/116.4f4b39f5.js"><link rel="prefetch" href="/assets/js/117.99352e11.js"><link rel="prefetch" href="/assets/js/118.c6ae6572.js"><link rel="prefetch" href="/assets/js/119.4ccbe778.js"><link rel="prefetch" href="/assets/js/12.042a92ff.js"><link rel="prefetch" href="/assets/js/120.edda1c4f.js"><link rel="prefetch" href="/assets/js/121.30a638ed.js"><link rel="prefetch" href="/assets/js/122.6efcefb1.js"><link rel="prefetch" href="/assets/js/123.91e6665b.js"><link rel="prefetch" href="/assets/js/124.f27e3d7e.js"><link rel="prefetch" href="/assets/js/125.c75712d5.js"><link rel="prefetch" href="/assets/js/126.ed756cce.js"><link rel="prefetch" href="/assets/js/127.2f06c74c.js"><link rel="prefetch" href="/assets/js/128.d5f6f30e.js"><link rel="prefetch" href="/assets/js/129.508b7eed.js"><link rel="prefetch" href="/assets/js/13.b5280c37.js"><link rel="prefetch" href="/assets/js/130.dc05f9aa.js"><link rel="prefetch" href="/assets/js/131.e0ba69b1.js"><link rel="prefetch" href="/assets/js/132.d79bcaa4.js"><link rel="prefetch" href="/assets/js/133.34acc01a.js"><link rel="prefetch" href="/assets/js/134.dabf64d5.js"><link rel="prefetch" href="/assets/js/135.ad90c915.js"><link rel="prefetch" href="/assets/js/136.dbb0074f.js"><link rel="prefetch" href="/assets/js/137.284ad365.js"><link rel="prefetch" href="/assets/js/138.a4b6856f.js"><link rel="prefetch" href="/assets/js/139.c9c1e20f.js"><link rel="prefetch" href="/assets/js/14.df02ba38.js"><link rel="prefetch" href="/assets/js/140.8b0a9269.js"><link rel="prefetch" href="/assets/js/141.9c7759c5.js"><link rel="prefetch" href="/assets/js/142.a4201a82.js"><link rel="prefetch" href="/assets/js/143.d7da6e8c.js"><link rel="prefetch" href="/assets/js/144.5e48e65d.js"><link rel="prefetch" href="/assets/js/145.a0e2633c.js"><link rel="prefetch" href="/assets/js/146.3c775f9b.js"><link rel="prefetch" href="/assets/js/147.22add89a.js"><link rel="prefetch" href="/assets/js/148.cfde1009.js"><link rel="prefetch" href="/assets/js/149.ffc835b5.js"><link rel="prefetch" href="/assets/js/15.fbdfc4ee.js"><link rel="prefetch" href="/assets/js/150.406c4b20.js"><link rel="prefetch" href="/assets/js/151.b2040eea.js"><link rel="prefetch" href="/assets/js/152.7bc65661.js"><link rel="prefetch" href="/assets/js/153.1d7c65e3.js"><link rel="prefetch" href="/assets/js/154.1309de49.js"><link rel="prefetch" href="/assets/js/155.81d3ee1f.js"><link rel="prefetch" href="/assets/js/156.154a4ef2.js"><link rel="prefetch" href="/assets/js/16.e5eb6147.js"><link rel="prefetch" href="/assets/js/17.57853c4a.js"><link rel="prefetch" href="/assets/js/18.cb9d7518.js"><link rel="prefetch" href="/assets/js/19.f354dc47.js"><link rel="prefetch" href="/assets/js/2.570d8a23.js"><link rel="prefetch" href="/assets/js/20.b5af7fad.js"><link rel="prefetch" href="/assets/js/21.0b1928fe.js"><link rel="prefetch" href="/assets/js/22.f78666de.js"><link rel="prefetch" href="/assets/js/23.29c3f366.js"><link rel="prefetch" href="/assets/js/24.6f596516.js"><link rel="prefetch" href="/assets/js/25.14067b60.js"><link rel="prefetch" href="/assets/js/26.74ba4989.js"><link rel="prefetch" href="/assets/js/27.13d60edd.js"><link rel="prefetch" href="/assets/js/28.9523cb32.js"><link rel="prefetch" href="/assets/js/29.8ec842e9.js"><link rel="prefetch" href="/assets/js/3.3fb3d2e0.js"><link rel="prefetch" href="/assets/js/30.805597a8.js"><link rel="prefetch" href="/assets/js/31.831b195d.js"><link rel="prefetch" href="/assets/js/32.063c672d.js"><link rel="prefetch" href="/assets/js/33.6d93fac3.js"><link rel="prefetch" href="/assets/js/34.56e8263c.js"><link rel="prefetch" href="/assets/js/35.dbe688bb.js"><link rel="prefetch" href="/assets/js/36.dc5af2c1.js"><link rel="prefetch" href="/assets/js/37.0a7494f6.js"><link rel="prefetch" href="/assets/js/38.fe4fc171.js"><link rel="prefetch" href="/assets/js/39.f5ed5e92.js"><link rel="prefetch" href="/assets/js/4.2c405ec8.js"><link rel="prefetch" href="/assets/js/40.fe7e2714.js"><link rel="prefetch" href="/assets/js/41.30b0811d.js"><link rel="prefetch" href="/assets/js/42.76f52d62.js"><link rel="prefetch" href="/assets/js/43.e7bb0817.js"><link rel="prefetch" href="/assets/js/44.ead0e883.js"><link rel="prefetch" href="/assets/js/45.235df046.js"><link rel="prefetch" href="/assets/js/46.5f09e829.js"><link rel="prefetch" href="/assets/js/47.67116354.js"><link rel="prefetch" href="/assets/js/48.31f34543.js"><link rel="prefetch" href="/assets/js/49.10b5ebba.js"><link rel="prefetch" href="/assets/js/5.6f47322c.js"><link rel="prefetch" href="/assets/js/50.c0f0b7f1.js"><link rel="prefetch" href="/assets/js/51.5143f3bf.js"><link rel="prefetch" href="/assets/js/52.eeddfd48.js"><link rel="prefetch" href="/assets/js/53.eb790db5.js"><link rel="prefetch" href="/assets/js/54.8fe5421c.js"><link rel="prefetch" href="/assets/js/55.d8f9004b.js"><link rel="prefetch" href="/assets/js/56.62ac9b92.js"><link rel="prefetch" href="/assets/js/57.a9caec0d.js"><link rel="prefetch" href="/assets/js/58.f93fc522.js"><link rel="prefetch" href="/assets/js/59.a81a03aa.js"><link rel="prefetch" href="/assets/js/6.8c2ea393.js"><link rel="prefetch" href="/assets/js/60.ab782775.js"><link rel="prefetch" href="/assets/js/61.6dd12daf.js"><link rel="prefetch" href="/assets/js/62.76f4b01f.js"><link rel="prefetch" href="/assets/js/63.6f8a4742.js"><link rel="prefetch" href="/assets/js/64.6f8bb1fa.js"><link rel="prefetch" href="/assets/js/65.4120a44b.js"><link rel="prefetch" href="/assets/js/66.360c2d2b.js"><link rel="prefetch" href="/assets/js/67.26f84d32.js"><link rel="prefetch" href="/assets/js/68.68f45e5e.js"><link rel="prefetch" href="/assets/js/69.e311eb56.js"><link rel="prefetch" href="/assets/js/7.6762b2d7.js"><link rel="prefetch" href="/assets/js/70.cea82674.js"><link rel="prefetch" href="/assets/js/71.783ddcf7.js"><link rel="prefetch" href="/assets/js/72.e5467385.js"><link rel="prefetch" href="/assets/js/73.b8fb681b.js"><link rel="prefetch" href="/assets/js/74.1bae37db.js"><link rel="prefetch" href="/assets/js/75.024387e5.js"><link rel="prefetch" href="/assets/js/76.a8e53010.js"><link rel="prefetch" href="/assets/js/77.8c55500a.js"><link rel="prefetch" href="/assets/js/78.7ce90bf5.js"><link rel="prefetch" href="/assets/js/79.ef71713f.js"><link rel="prefetch" href="/assets/js/8.788a6364.js"><link rel="prefetch" href="/assets/js/80.acad589d.js"><link rel="prefetch" href="/assets/js/81.02670d10.js"><link rel="prefetch" href="/assets/js/82.53b7b1ac.js"><link rel="prefetch" href="/assets/js/83.99eb8581.js"><link rel="prefetch" href="/assets/js/84.d1535ce3.js"><link rel="prefetch" href="/assets/js/85.fe2b7de9.js"><link rel="prefetch" href="/assets/js/86.41850272.js"><link rel="prefetch" href="/assets/js/87.1cdc6df9.js"><link rel="prefetch" href="/assets/js/88.01bf3461.js"><link rel="prefetch" href="/assets/js/89.17c69819.js"><link rel="prefetch" href="/assets/js/9.3813842d.js"><link rel="prefetch" href="/assets/js/90.f6ae7e35.js"><link rel="prefetch" href="/assets/js/91.507bc284.js"><link rel="prefetch" href="/assets/js/92.90551782.js"><link rel="prefetch" href="/assets/js/93.dc442d78.js"><link rel="prefetch" href="/assets/js/94.315f4e94.js"><link rel="prefetch" href="/assets/js/95.ccd6c6bf.js"><link rel="prefetch" href="/assets/js/96.0c6d89d0.js"><link rel="prefetch" href="/assets/js/97.1a9f10a9.js"><link rel="prefetch" href="/assets/js/99.54c8207b.js">
    <link rel="stylesheet" href="/assets/css/0.styles.0dbae9ec.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">whoway</span></a> <div class="links" style="max-width:nullpx;"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">🎓Coding</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/00.Coding/TheBeautyOfProgramming/" class="nav-link">🔖编程之美题解</a></li><li class="dropdown-item"><!----> <a href="/00.Coding/CodeWarehouse/" class="nav-link">🔖代码意识流</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">🚀语言</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/01.Language/Overview/" class="nav-link">🔖概述</a></li><li class="dropdown-item"><!----> <a href="/01.Language/C/" class="nav-link">⭐️C</a></li><li class="dropdown-item"><!----> <a href="/01.Language/Cpp/" class="nav-link">🚀C++</a></li><li class="dropdown-item"><!----> <a href="/01.Language/Java/" class="nav-link">☕️Java</a></li><li class="dropdown-item"><!----> <a href="/01.Language/Python/" class="nav-link">🧩Python3</a></li></ul></div></div><div class="nav-item"><a href="/02.Hardware/" class="nav-link">✔️硬件基础</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">⭐️软件基础</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/03.Software/01.DataStructureAndAlgorithm/" class="nav-link">🐾数据结构和算法</a></li><li class="dropdown-item"><!----> <a href="/03.Software/02.OS/" class="nav-link">💻操作系统</a></li><li class="dropdown-item"><!----> <a href="/03.Software/03.Net/" class="nav-link">☁️计算机网络</a></li><li class="dropdown-item"><!----> <a href="/03.Software/04.SE/" class="nav-link">✅软件工程</a></li></ul></div></div><div class="nav-item"><a href="/04.Database/" class="nav-link">🎨数据库</a></div><div class="nav-item"><a href="/05.Engineer/" class="nav-link router-link-active">🔖学术/工程</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">⚙️工具</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/06.Tools/01.employment/" class="nav-link">🔖求职</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/02.efficiency/" class="nav-link">🚀效能</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/03.windows/" class="nav-link">⚙️Windows</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/04.design/" class="nav-link">🧩设计</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/05.linux/" class="nav-link">🐉Linux</a></li></ul></div></div><div class="nav-item"><a href="https://github.com/whoway" target="_blank" rel="noopener noreferrer" class="nav-link external">
  GitHub
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <div class="sidebar"><nav class="nav-links"><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">🎓Coding</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/00.Coding/TheBeautyOfProgramming/" class="nav-link">🔖编程之美题解</a></li><li class="dropdown-item"><!----> <a href="/00.Coding/CodeWarehouse/" class="nav-link">🔖代码意识流</a></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">🚀语言</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/01.Language/Overview/" class="nav-link">🔖概述</a></li><li class="dropdown-item"><!----> <a href="/01.Language/C/" class="nav-link">⭐️C</a></li><li class="dropdown-item"><!----> <a href="/01.Language/Cpp/" class="nav-link">🚀C++</a></li><li class="dropdown-item"><!----> <a href="/01.Language/Java/" class="nav-link">☕️Java</a></li><li class="dropdown-item"><!----> <a href="/01.Language/Python/" class="nav-link">🧩Python3</a></li></ul></div></div><div class="nav-item"><a href="/02.Hardware/" class="nav-link">✔️硬件基础</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">⭐️软件基础</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/03.Software/01.DataStructureAndAlgorithm/" class="nav-link">🐾数据结构和算法</a></li><li class="dropdown-item"><!----> <a href="/03.Software/02.OS/" class="nav-link">💻操作系统</a></li><li class="dropdown-item"><!----> <a href="/03.Software/03.Net/" class="nav-link">☁️计算机网络</a></li><li class="dropdown-item"><!----> <a href="/03.Software/04.SE/" class="nav-link">✅软件工程</a></li></ul></div></div><div class="nav-item"><a href="/04.Database/" class="nav-link">🎨数据库</a></div><div class="nav-item"><a href="/05.Engineer/" class="nav-link router-link-active">🔖学术/工程</a></div><div class="nav-item"><div class="dropdown-wrapper"><a class="dropdown-title"><span class="title">⚙️工具</span> <span class="arrow right"></span></a> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/06.Tools/01.employment/" class="nav-link">🔖求职</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/02.efficiency/" class="nav-link">🚀效能</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/03.windows/" class="nav-link">⚙️Windows</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/04.design/" class="nav-link">🧩设计</a></li><li class="dropdown-item"><!----> <a href="/06.Tools/05.linux/" class="nav-link">🐉Linux</a></li></ul></div></div><div class="nav-item"><a href="https://github.com/whoway" target="_blank" rel="noopener noreferrer" class="nav-link external">
  GitHub
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav>  <ul class="sidebar-links"><li><div class="sidebar-group first"><p class="sidebar-heading open"><span>Linux命令工程场景</span> <!----></p> <ul class="sidebar-group-items"><li><a href="/05.Engineer/E4.Linux%E5%91%BD%E4%BB%A4%E5%B7%A5%E7%A8%8B%E5%9C%BA%E6%99%AF.html#✔️代码获取" class="sidebar-link">✔️代码获取</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/05.Engineer/E4.Linux%E5%91%BD%E4%BB%A4%E5%B7%A5%E7%A8%8B%E5%9C%BA%E6%99%AF.html#_1-解压缩-tar双后缀" class="sidebar-link">1.解压缩-tar双后缀</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/E4.Linux%E5%91%BD%E4%BB%A4%E5%B7%A5%E7%A8%8B%E5%9C%BA%E6%99%AF.html#_2-解压缩-单后缀" class="sidebar-link">2.解压缩-单后缀</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/E4.Linux%E5%91%BD%E4%BB%A4%E5%B7%A5%E7%A8%8B%E5%9C%BA%E6%99%AF.html#_3-linux命令：返回上一次目录" class="sidebar-link">3.linux命令：返回上一次目录</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/E4.Linux%E5%91%BD%E4%BB%A4%E5%B7%A5%E7%A8%8B%E5%9C%BA%E6%99%AF.html#_4-shell中5种括号的作用-、-、-、-、" class="sidebar-link">4.shell中5种括号的作用()、(())、[]、[[]]、{}</a></li></ul></li><li><a href="/05.Engineer/E4.Linux%E5%91%BD%E4%BB%A4%E5%B7%A5%E7%A8%8B%E5%9C%BA%E6%99%AF.html#✔️代码提交" class="sidebar-link">✔️代码提交</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/E4.Linux%E5%91%BD%E4%BB%A4%E5%B7%A5%E7%A8%8B%E5%9C%BA%E6%99%AF.html#_3-linux-下文件夹的复制、覆盖以及确认问题解决" class="sidebar-link">3.linux 下文件夹的复制、覆盖以及确认问题解决</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/05.Engineer/E4.Linux%E5%91%BD%E4%BB%A4%E5%B7%A5%E7%A8%8B%E5%9C%BA%E6%99%AF.html#_4-linux你的用户下各种小玩意" class="sidebar-link">4.Linux你的用户下各种小玩意</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/05.Engineer/E4.Linux%E5%91%BD%E4%BB%A4%E5%B7%A5%E7%A8%8B%E5%9C%BA%E6%99%AF.html#bash-history" class="sidebar-link">.bash_history</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/E4.Linux%E5%91%BD%E4%BB%A4%E5%B7%A5%E7%A8%8B%E5%9C%BA%E6%99%AF.html#bash-logout" class="sidebar-link">.bash_logout</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/E4.Linux%E5%91%BD%E4%BB%A4%E5%B7%A5%E7%A8%8B%E5%9C%BA%E6%99%AF.html#bashrc" class="sidebar-link">.bashrc</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/E4.Linux%E5%91%BD%E4%BB%A4%E5%B7%A5%E7%A8%8B%E5%9C%BA%E6%99%AF.html#gitconfig" class="sidebar-link">.gitconfig</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/E4.Linux%E5%91%BD%E4%BB%A4%E5%B7%A5%E7%A8%8B%E5%9C%BA%E6%99%AF.html#profile" class="sidebar-link">.profile</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/E4.Linux%E5%91%BD%E4%BB%A4%E5%B7%A5%E7%A8%8B%E5%9C%BA%E6%99%AF.html#viminfo" class="sidebar-link">.viminfo</a></li><li class="sidebar-sub-header"><a href="/05.Engineer/E4.Linux%E5%91%BD%E4%BB%A4%E5%B7%A5%E7%A8%8B%E5%9C%BA%E6%99%AF.html#vimrc" class="sidebar-link">.vimrc</a></li></ul></li></ul></div></li></ul> </div> <div class="page"> <div class="content"><h1 id="linux命令工程场景"><a href="#linux命令工程场景" class="header-anchor">#</a> Linux命令工程场景</h1> <div class="language-txt line-numbers-mode"><pre class="language-text"><code>&lt;font style=&quot;background:yellow&quot;&gt;
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><h2 id="✔️代码获取"><a href="#✔️代码获取" class="header-anchor">#</a> ✔️代码获取</h2> <h3 id="_1-解压缩-tar双后缀"><a href="#_1-解压缩-tar双后缀" class="header-anchor">#</a> 1.解压缩-tar双后缀</h3> <ul><li>解压缩,解压缩到当前目录</li></ul> <div class="language-shell line-numbers-mode"><pre class="language-shell"><code><span class="token function">tar</span> -xzvf temp.tar.gz -C ./
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><ul><li><p><font style="background:yellow;">记忆法</font></p></li> <li><p><font style="background:yellow;">第1部分「解决用途」</font></p> <ul><li><p><code>-c</code>: 「create」建立压缩档案</p></li> <li><p><code>-x</code>：解压「<font style="background:yellow;">联想记忆：rwx的x是执行，就当“执行”是解压吧</font></p></li> <li><p><code>-t</code>：查看内容</p></li> <li><p><code>-r</code>：向压缩归档文件末尾追加文件</p></li> <li><p><code>-u</code>：「update」更新原压缩包中的文件</p></li> <li><p>这五个是独立的命令，压缩解压都要用到其中一个，<font style="background:pink;">可以和别的命令连用<strong>但只能用其中一个</strong></font>。下面的参数是根据需要在压缩或解压档案时可选的。</p></li></ul></li> <li><p><font style="background:yellow;">第2部分「解决后缀」</font></p> <ul><li><code>-z</code>：「对应test.<strong>tar.gz</strong>，记忆就是尾巴是z」有gzip属性的</li> <li><code>-j</code>：「对应test.<strong>tar.bz</strong>，这个强行记忆」有bz2属性的</li> <li><code>-Z</code>：有compress属性的</li> <li><code>-v</code>：「常用」显示所有过程</li> <li>-O：将文件解开到标准输出</li></ul></li> <li><p><font style="background:yellow;">第3部分「必选，只能放最后！」</font></p> <ul><li><code>-f</code>: 使用档案名字，切记，<font style="background:pink;">这个参数是<strong>最后一个参数</strong>，<strong>后面只能接档案名</strong></font>。</li></ul></li></ul> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code><span class="token comment"># tar -cf all.tar *.jpg</span>
这条命令是将所有.jpg的文件打成一个名为all.tar的包。-c是表示产生新的包，-f指定包的文件名。

<span class="token comment"># tar -rf all.tar *.gif</span>
这条命令是将所有.gif的文件增加到all.tar的包里面去。-r是表示增加文件的意思。

<span class="token comment"># tar -uf all.tar logo.gif</span>
这条命令是更新原来tar包all.tar中logo.gif文件，-u是表示更新文件的意思。

<span class="token comment"># tar -tf all.tar</span>
这条命令是列出all.tar包中所有文件，-t是列出文件的意思

<span class="token comment"># tar -xf all.tar</span>
这条命令是解出all.tar包中所有文件，-t是解开的意思

压缩

<span class="token function">tar</span> -cvf jpg.tar *.jpg //将目录里所有jpg文件打包成tar.jpg 

<span class="token function">tar</span> -czf jpg.tar.gz *.jpg   //将目录里所有jpg文件打包成jpg.tar后，并且将其用gzip压缩，生成一个gzip压缩过的包，命名为jpg.tar.gz

 <span class="token function">tar</span> -cjf jpg.tar.bz2 *.jpg //将目录里所有jpg文件打包成jpg.tar后，并且将其用bzip2压缩，生成一个bzip2压缩过的包，命名为jpg.tar.bz2

<span class="token function">tar</span> -cZf jpg.tar.Z *.jpg   //将目录里所有jpg文件打包成jpg.tar后，并且将其用compress压缩，生成一个umcompress压缩过的包，命名为jpg.tar.Z

<span class="token function">rar</span> a jpg.rar *.jpg //rar格式的压缩，需要先下载rar <span class="token keyword">for</span> linux

<span class="token function">zip</span> jpg.zip *.jpg //zip格式的压缩，需要先下载zip <span class="token keyword">for</span> linux



解压

<span class="token function">tar</span> -xvf file.tar //解压 tar包

<span class="token function">tar</span> -xzvf file.tar.gz //解压tar.gz

<span class="token function">tar</span> -xjvf file.tar.bz2   //解压 tar.bz2

<span class="token function">tar</span> -xZvf file.tar.Z   //解压tar.Z

<span class="token function">unrar</span> e file.rar //解压rar

<span class="token function">unzip</span> file.zip //解压zip


</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br></div></div><h3 id="_2-解压缩-单后缀"><a href="#_2-解压缩-单后缀" class="header-anchor">#</a> 2.解压缩-单后缀</h3> <ul><li><p>1、<code>*.tar</code> 用 <code>tar -xvf</code> 解压</p></li> <li><p>2、<code>*.gz</code> 用 <code>gzip -d</code>或者<code>gunzip</code> 解压</p></li> <li><p>3、<code>*.tar.gz</code>和<code>*.tgz</code> 用 <code>tar -xzf</code> 解压</p></li> <li><p>4、<code>*.bz2</code> 用 <code>bzip2 -d</code>或者用<code>bunzip2</code> 解压</p></li> <li><p>5、<code>*.tar.bz2</code>用<code>tar -xjf</code> 解压</p></li> <li><p>6、<code>*.Z</code> 用 <code>uncompress</code> 解压</p></li> <li><p>7、<code>*.tar.Z</code> 用<code>tar -xZf</code> 解压</p></li> <li><p>8、<code>*.rar</code> 用 <code>unrar e</code>解压</p></li> <li><p>9、<code>*.zip</code> 用 <code>unzip</code> 解压</p></li></ul> <blockquote><p>参考资料：<a href="https://mp.weixin.qq.com/s/iKwmdOxBkaEKItHyZZke9w" target="_blank" rel="noopener noreferrer">https://mp.weixin.qq.com/s/iKwmdOxBkaEKItHyZZke9w<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></p></blockquote> <h3 id="_3-linux命令：返回上一次目录"><a href="#_3-linux命令：返回上一次目录" class="header-anchor">#</a> 3.linux命令：返回上一次目录</h3> <p>有时候千辛万苦进入了一个很深层的目录，一不小心输入了cd并回车，有什么办法快速回到刚才所在的目录呢？对于bash来说，只需要很管理的一个命令：</p> <ul><li><code>cd -</code></li></ul> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code>该命令等同于cd <span class="token environment constant">$OLDPWD</span>，关于这一点在bash的手册页<span class="token punctuation">(</span>可使用命令man bash访问其手册页<span class="token punctuation">)</span>中有介绍：

An argument of - is equivalent to <span class="token environment constant">$OLDPWD</span><span class="token builtin class-name">.</span> 
<span class="token number">1</span>
并且它还会返回上一次目录的物理路径。
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><h3 id="_4-shell中5种括号的作用-、-、-、-、"><a href="#_4-shell中5种括号的作用-、-、-、-、" class="header-anchor">#</a> 4.shell中5种括号的作用<code>()</code>、<code>(())</code>、<code>[]</code>、<code>[[]]</code>、<code>{}</code></h3> <ul><li>参考自：<a href="https://blog.csdn.net/taiyang1987912/article/details/39551385" target="_blank" rel="noopener noreferrer">https://blog.csdn.net/taiyang1987912/article/details/39551385<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a> <ul><li>一篇神一般的总结</li></ul></li></ul> <p>记忆方法：</p> <ul><li>2组，<code>()</code>和<code>(())</code></li> <li>2组，<code>[]</code>和<code>[[]]</code></li> <li>1组，<code>{}</code></li></ul> <h4 id="_4-1-单小括号"><a href="#_4-1-单小括号" class="header-anchor">#</a> 4.1.单小括号 <code>()</code></h4> <ul><li>①命令组</li></ul> <p>括号中的命令将会<strong>新开一个子shell</strong>顺序执行，所以括号中的变量不能够被脚本余下的部分使用。</p> <p>括号中多个命令之间用分号隔开，最后一个命令可以没有分号，各命令和括号之间不必有空格。</p> <ul><li>②命令替换</li></ul> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code>等同于<span class="token variable"><span class="token variable">`</span>cmd<span class="token variable">`</span></span>，shell扫描一遍命令行，发现了<span class="token variable"><span class="token variable">$(</span>cmd<span class="token variable">)</span></span>结构，便将<span class="token variable"><span class="token variable">$(</span>cmd<span class="token variable">)</span></span>中的cmd执行一次，得到其标准输出，再将此输出放到原来命令。有些shell不支持，如tcsh。
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><ul><li>③用于初始化数组</li></ul> <p>如：<code>array=(a b c d)</code></p> <h4 id="_4-2-双小括号"><a href="#_4-2-双小括号" class="header-anchor">#</a> 4.2.双小括号<code>(( ))</code></h4> <ul><li>①整数扩展。</li></ul> <p>这种扩展计算是整数型的计算，不支持浮点型。((exp))结构扩展并计算一个算术表达式的值，如果表达式的结果为0，那么返回的退出状态码为1，或者 是&quot;假&quot;，而一个非零值的表达式所返回的退出状态码将为0，或者是&quot;true&quot;。若是逻辑判断，表达式exp为真则为1,假则为0。</p> <ul><li>②只要括号中的运算符、表达式符合C语言运算规则，都可用在<code>$((exp))</code>中，甚至是三目运算符。</li></ul> <p>作不同进位(如二进制、八进制、十六进制)运算时，输出结果全都自动转化成了十进制。如：<code>echo $((16#5f))</code> 结果为95 (16进位转十进制)</p> <ul><li>③单纯用 (( )) 也可<strong>重定义变量值</strong></li></ul> <p>比如 a=5; ((a++)) 可将 $a 重定义为6</p> <ul><li>④常用于算术运算比较，双括号中的变量可以不使用<code>$</code>符号前缀。</li></ul> <p>括号内支持多个表达式用逗号分开。 只要括号中的表达式符合C语言运算规则,比如可以直接使用for((i=0;i&lt;5;i++)), 如果不使用双括号, 则为for i in <code>seq 0 4</code>或者<code>for i in {0..4}</code>。再如可以直接使用<code>if (($i&lt;5)), 如果不使用双括号, 则为if [ $i -lt 5 ]。</code></p> <h2 id="✔️代码提交"><a href="#✔️代码提交" class="header-anchor">#</a> ✔️代码提交</h2> <h2 id="_3-linux-下文件夹的复制、覆盖以及确认问题解决"><a href="#_3-linux-下文件夹的复制、覆盖以及确认问题解决" class="header-anchor">#</a> 3.linux 下文件夹的复制、覆盖以及确认问题解决</h2> <ul><li>问覆盖</li> <li>https://blog.csdn.net/QH_JAVA/article/details/51597604</li></ul> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code><span class="token punctuation">[</span>root@CentosLinux gcc<span class="token punctuation">]</span><span class="token comment"># ls</span>
solve.cpp
<span class="token punctuation">[</span>root@CentosLinux gcc<span class="token punctuation">]</span><span class="token comment"># cd ..</span>
<span class="token punctuation">[</span>root@CentosLinux ~<span class="token punctuation">]</span><span class="token comment"># ls</span>
gcc  myfrp  solve.cpp  webserver
<span class="token punctuation">[</span>root@CentosLinux ~<span class="token punctuation">]</span><span class="token comment"># cp solve.cpp gcc/</span>
cp: overwrite ‘gcc/solve.cpp’? y
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><h2 id="_4-linux你的用户下各种小玩意"><a href="#_4-linux你的用户下各种小玩意" class="header-anchor">#</a> 4.Linux你的用户下各种小玩意</h2> <h3 id="bash-history"><a href="#bash-history" class="header-anchor">#</a> <code>.bash_history</code></h3> <ul><li>应用场景：有公司用户为你复现了某代码，可以用这个查看历史</li> <li>清除linux的history 命令历史记录<code>history -c</code></li> <li>.bash_history是bash shell的历史记录文件，里面记录了你在bash shell中输入的所有命令。可通过HISSIZE环境变量设置在历史记录文件里保存记录的条数</li></ul> <h3 id="bash-logout"><a href="#bash-logout" class="header-anchor">#</a> <code>.bash_logout</code></h3> <ul><li>bash_logout在退出shell时被读取。所以我们可把一些清理工作的命令放到这文件中</li></ul> <h3 id="bashrc"><a href="#bashrc" class="header-anchor">#</a> <code>.bashrc</code></h3> <h3 id="gitconfig"><a href="#gitconfig" class="header-anchor">#</a> <code>.gitconfig</code></h3> <h3 id="profile"><a href="#profile" class="header-anchor">#</a> <code>.profile</code></h3> <ul><li>在 ==/etc目录==的bashrc和profile是系统级（全局）的配置文件，当在==用户主目录==下找不到.bash_profile 和.bashrc时，就会读取这两个文件。</li></ul> <h3 id="viminfo"><a href="#viminfo" class="header-anchor">#</a> <code>.viminfo</code></h3> <h3 id="vimrc"><a href="#vimrc" class="header-anchor">#</a> <code>.vimrc</code></h3> <ul><li>resource，资源</li></ul> <div class="language-txt line-numbers-mode"><pre class="language-text"><code>### `.ssh`文件夹

### `.cache`文件夹
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br></div></div></div> <div class="page-edit"><!----> <!----></div> <!----> </div> <!----></div></div>
    <script src="/assets/js/app.c70e21ad.js" defer></script><script src="/assets/js/98.43be3caa.js" defer></script>
  </body>
</html>
